<template>
  <div class="body-container login_">
    <el-container>
      <el-header></el-header>
      <el-main :style="defaultHeight">
        <transition name="el-zoom-in-center">
          <router-view></router-view>
        </transition>
      </el-main>
      <div class="foot">
        <Copyright></Copyright>
      </div>
    </el-container>
  </div>
</template>

<script>
import Copyright from "@/components/copyright";

export default {
  name: "UserInterface",
  components: {Copyright},
  data() {
    return {
      defaultHeight: {
        height: ""
      }
    };
  },
  methods: {
    //定义方法，获取高度减去头尾
    getHeight() {
      this.defaultHeight.height = window.innerHeight - 120 + "px";
    }
  },
  created() {
    //页面创建时执行一次getHeight进行赋值，顺道绑定resize事件
    window.addEventListener("resize", this.getHeight);
    this.getHeight();
  }
}
</script>

<style scoped>
* {
  padding: 0;
  margin: 0;
}
.el-header, .el-footer {
  background-color: #E4ECFC;
  color: #333;
  text-align: center;
  line-height: 60px;
}
.el-main {
  color: #333;
  text-align: center;
  line-height: 160px;
}
.log_main {
  line-height: 20px;
  background-color: white;
  border-radius: 5px;
  margin-top: 3%;
  height: 82%;
  margin-left: 30%;
  box-shadow: 0 0 2.1875rem 0 rgba(154,161,171,0.15);
  text-align: center;
}
.login_ {
  background-color: #E4ECFC;
  height: 100%;
  width: 100%;
  border-radius: 0;
}
.foot {
  background-color: #E4ECFC;
}
</style>